﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernateUnitOfWork;
using XWord.Fundamental.Domain;
using Iesi.Collections.Generic;

namespace ConsoleApplication1
{
   public class GapFillTest
    {
       public static void Test1()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2009, 12, 22);
           rca.Content = @"In families with two working parents, fathers may have more impact on a child’s language development than mothers, a new study suggests.
Researchers _______ 92 families from 11 child care centers before their children were a year old, interviewing each to establish income, level of education and child care arrangements. Overall, it was a group of well-educated middle-class families with married parents both living in the home.
When the children were 2, researchers videotaped them at home in free-play sessions with both parent, _______ all of their speech. The study will appear in the November issue of The Journal of Applied Developmental Psychology.
The scientists measured the _______ number of utterances (话语) of the parents, the number of different words they used, the complexity of their sentences and other _______ of their speech. On average, fathers spoke less than mothers did, but they did not differ in the length of utterances or proportion of questions asked. 
Finally, the researchers _______ the children’s speech at age 3, using a standardized language test. The only predictors of high scores on the test were the mother’s level of education, the _______ of child care and the number of different words the father used.
The researchers are _______ why the father’s speech, and not the mother’s, had an effect.
“It’s well _______ that the mother’s language does have an impact,” said Nadya Pancsofar, the lead author of the study. It could be that the high-functioning mothers in the study had _______ had a strong influence on their children’s speech development, Ms. Pancsofar said, “or it may be that mothers are _______ in a way we didn’t measure in the study.”
";
           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();
           string[] gapfills=new string[]{
               "already","analyzed","aspects","characters",
               "contributing","describing","established","quality",
               "quoted","recording","recruited","total",
               "unconscious","unsure","yet"};
      
           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Article = rca;
               entity.Name = gapfills[i];
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test2()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2009, 6, 22);
           rca.Content = @"　　Every year in the first week of my English class, some students inform me that writing is too hard. They never write, unless assignments __47__ it. They find the writing process __48__ and difficult.
　　How awful to be able to speak in a language but not to write in it --- __49__ English, with its rich vocabulary. Being able to speak but not write is like living in an __50__ mansion(豪宅) and never leaving one small room. When I meet students who think they can’t write, I knots, as a teacher my __51__ is to show them the rest of the rooms. My task is to build fluency while providing the opportunity inherent in any writing activity to __52__ the moral and emotional development of my students. One great way to do this is by having students write in a journal in class every day.
　　Writing ability is like strength training. Writing needs to be done __53__, just like exercise; just as muscles grow stronger with exercise, writing skills improve quickly with writing practice. I often see a rise in student confidence and __54__ after only a few weeks of journal writing.
　　Expressing oneself in writing is one of the most important skills I teach to strengthen the whole student. When my students practice journal writing, they are practicing for their future academic, political, and __55__ lives. They build skills so that some day they might write a great novel, a piece of sorely needed legislation, or the perfect love letter. Every day that they write in their journals puts them a step __56__ to fluency, eloquence （雄辩），and command of language.
";
           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();

           string[] gapfills = new string[]{
               "closer","daily","emotional","enhance",
               "enormous","especially","hinder","mission",
               "painful","performance","profession","remarkably",
               "require","sensitive","urge"};
          
           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test3()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2008, 12, 22);
           rca.Content = @"A bookless life is an incomplete life. Books influence the depth and breadth of life. They meet the natural 47______ for freedom, for expression, for creativity and beauty of life. Learners, therefore, must have books, and the right type of book, for the satisfaction of their need. Readers turn 48______ to books because their curiosity concerning all manners of things, their eagerness to share in the experiences of others and their need to 49______ from their own limited environment lead them to find in books food for the the mind and spirit. Through their reading they find a deeper significance to life as books acquaint them with life in the world as it was and it is now. They are presented with a 50______of human experiences and come to 51______ other ways of thought and living. And while 52______ their own relationships and responses to readers often find that the  53______ in their stories are going through similar adjustments, which help to clarify and give significance to their own.
Books provide 54______ material for readers' imagination to grow. Imagination is a valuable quality and a motivating power, and stimulates achievement. While enriching their imagination, books 55______ their outlook, develop a fact-finding attitude and train them to use leisure 56______. The social and educational significance of the readers' books cannot be overestimated in an academic library.
";
           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();
          

           string[] gapfills = new string[]{
               "abundant","characters","communicating","completely",
               "derive","desire","diversity","escape",
               "establishing","narrow","naturally","personnel",
               "properly","respect","widen"};

           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test4()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2008, 6, 22);
           rca.Content = @"　　Every year in the first week of my English class, some students inform me that writing is too hard. They never write, unless assignments __47__ it. They find the writing process __48__ and difficult.
　　How awful to be able to speak in a language but not to write in it --- __49__ English, with its rich vocabulary. Being able to speak but not write is like living in an __50__ mansion(豪宅) and never leaving one small room. When I meet students who think they can’t write, I knots, as a teacher my __51__ is to show them the rest of the rooms. My task is to build fluency while providing the opportunity inherent in any writing activity to __52__ the moral and emotional development of my students. One great way to do this is by having students write in a journal in class every day.
　　Writing ability is like strength training. Writing needs to be done __53__, just like exercise; just as muscles grow stronger with exercise, writing skills improve quickly with writing practice. I often see a rise in student confidence and __54__ after only a few weeks of journal writing.
　　Expressing oneself in writing is one of the most important skills I teach to strengthen the whole student. When my students practice journal writing, they are practicing for their future academic, political, and __55__ lives. They build skills so that some day they might write a great novel, a piece of sorely needed legislation, or the perfect love letter. Every day that they write in their journals puts them a step __56__ to fluency, eloquence （雄辩），and command of language.
";
           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();

           string[] gapfills = new string[]{
               "closer","daily","emotional","enhance",
               "enormous","especially","hinder","mission",
               "painful","performance","profession","remarkably",
               "require","sensitive","urge"};

           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test5()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2007, 12, 22);
           rca.Content = @"As war spreads to many corners of the globe, children sadly have been drawn into the center of conflicts. In Afghanistan, Bosnia, and Colombia, however, groups of children have been taking part in peace education 47 . The children, after learning to resolve conflicts, took on the  48  of peacemakers. The Children’s Movement for Peace in Colombia was even nominated (提名) for the Nobel Peace Prize in 1998. Groups of children 49  as peacemakers studied human rights and poverty issues in Colombia, eventually forming a group with five other schools in Bogota known as The Schools of Peace.
The classroom 50  opportunities for children to replace angry, violent behaviors with 51 , peaceful ones. It is in the classroom that caring and respect for each person empowers children to take a step 52  toward becoming peacemakers. Fortunately, educators have access to many online resources that are 53  useful when helping children along the path to peace. The Young Peacemakers Campaign. The World Centers of Compassion for Children International call attention to children’s rights and how to help the 55  of war. Starting a Peacemakers’ Club is a praiseworthy venture for a class and one that could spread to other classrooms and ideally affect the culture of the 56  school.
";
           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();


           string[] gapfills = new string[]{
               "acting","assuming","comprehensive","cooperative",
               "entire","especially","forward","images",
               "information","offers","projects","respectively",
               "role","technology","victims"};

           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test6()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2007, 6, 22);
           rca.Content = @"    Years ago, doctors often said that pain was a normal part of life. In particular, when older patients __47__ of pain, they were told it was a natural part of aging and they would have to learn to live with it.
Times have changed. Today, we take pain __48__. Indeed, pain is now considered the fifth vital sign, as important as blood pressure, temperature, breathing rate and pulse in __49__ a person’s well-being. We know that chronic (慢性的) pain can disrupt (扰乱) a person’s life, causing problems that __50__ from missed work to depression.
That’s why a growing number of hospitals now depend upon physicians who __51__ in pain medicine. Not only do we evaluate the cause of the pain, which can help us treat the pain better, but we also help provide comprehensive therapy for depression and other psychological and social __52__ related to chronic pain. Such comprehensive therapy often __53__ the work of social workers, psychiatrists (心理医生) and psychologists, as well as specialists in pain medicine.
This modern __54__ for pain management has led to a wealth of innovative treatments which are more effective and with fewer side effects than ever before. Decades ago, there were only a __55__ number of drugs available, and many of them caused __56__ side effects in older people, including dizziness and fatigue. This created a double-edged sword: the medications helped relieve the pain but caused other problems that could be worse than the pain itself.
";
           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();

           string[] gapfills = new string[]{
               "result","involves","significant","range",
               "relieved","issues","seriously","magnificent",
               "determining","limited","gravely","complained",
               "respect","prompting","specialize"};

           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test7()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2006, 12, 22);
           rca.Content = @"    The flood of women into the job market boosted economic growth and changed U.S. society in many ways. Many in-home jobs that used to be done __47__ by women—ranging from family shopping to preparing meals to doing __48__ work—still need to be done by someone. Husbands and children now do some of these jobs, a __49__ that has changed the target market for many products. Or a working woman may face a crushing “poverty of time” and look for help elsewhere, creating opportunities for producers of frozen meals, child care centers, dry cleaners, financial services, and the like.
Although there is still a big wage __50__ between men and women, the income working women __51__ gives them new independence and buying power. For example, women now __52__ about half of all cars. Not long ago, many cars dealers __53__ women shoppers by ignoring them or suggesting that they come back with their husbands. Now car companies have realized that women are __54__ customers. It’s interesting that some leading Japanese car dealers were the first to __55__ pay attention to women customers. In Japan, fewer women have jobs or buy cars—the Japanese society is still very much male-oriented. Perhaps it was the __56__ contrast with Japanese society that prompted American firms to pay more attention to women buyers.
";

           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();

           string[] gapfills = new string[]{
               "scale","retailed","generate","extreme",
               "technically","affordable","situation","really",
               "potential","gap","voluntary","excessive",
               "insulted","purchase","primarily"};

           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }

       public static void Test8()
       {
           RCArticle rca = new RCArticle();
           rca.CreateTime = new DateTime(2006, 6, 22);
           rca.Content = @"El Nino is name given to the mysterious and often unpredictable change in the climate of the world. This strange __47__ happens every five to eight years. It starts in the Pacific Ocean and is thought to be caused by a failure in the trade winds (信风)，which affects the ocean currents driven by these winds. As the trade winds lessen in __48__, the ocean temperatures rise, causing the Peru current flowing in from the east to warm up by as much as 5℃.
The warming of the ocean has far-reaching effects. The hot, humid (潮湿的) air over the ocean causes severe __49__ thunderstorms. The rainfall is increased across South America. __50__ floods to Peru. In the West pacific, there are droughts affecting Australia and Indonesia. So while some parts of the world prepare for heavy rains and floods, other parts face drought, poor crops and __51__.
El Nino usually lasts for about 18 months. The 1982-83 El Nino brought the most __52__ weather in modern history. Its effect was worldwide and it left more than 2,000 people dead and caused over eight billion pounds __53__ of damage. The 1990 El Nino lasted until June 1995. Scientists __54__ this to be the longest El Nino for 2,000 years.
Nowadays, weather experts are able to forecast when an El Nino will __55__, but they are still not __56__ sure what leads to it or what affects how strong it will be.
";


           rca.ArticleType = 1;
           rca.GapFillList = new HashedSet<GapFill>();

           string[] gapfills = new string[]{
               "estimate","strength","deliberately","notify",
               "tropical","phenomenon","stable","attraction",
               "completely","destructive","starvation","bringing",
               "exhaustion","worth","strike"};

           for (int i = 0; i < gapfills.Length; i++)
           {
               GapFill entity = new GapFill();
               entity.Name = gapfills[i];
               entity.Article = rca;
               entity.Priority = i;
               entity.AnswerIndex = -1;
               rca.GapFillList.Add(entity);
           }
           UnitOfWork.CurrentSession.Save(rca);
           UnitOfWork.CurrentSession.Flush();
       }
    }
}
